package com.gitee.hongruisun.pay.payport;

import java.util.HashMap;
import java.util.Map;

public class PayStategy {
    private PayStategy(){}
    private static Map<String,Payment> PAY_MAP = new HashMap<>();
    static {
        PAY_MAP.put("ALI_PAY",new AliPay());
        PAY_MAP.put("WECHAT_PAY",new WechatPay());
        PAY_MAP.put("UNION_PAY",new UnionPay());
        PAY_MAP.put("JD_PAY",new JDPay());
    }

    public static Payment getPayStategy(String key){
        return PAY_MAP.get(key);
    }
}
